/**
 *
 */
package idao.engine.parameter;

/**
 * The parameter expression represents the value's index in the dao method's arguments
 * array.
 * That is, which argument will be used as value of this sql parameter.
 * 
 * @author huhao
 */
class ArgIndexParameter extends SqlParameter
{

    private int argIndex;

    public ArgIndexParameter(int parameterIndex, String parameterExpression)
    {
        super(parameterIndex, parameterExpression);
        argIndex = Integer.parseInt(parameterExpression) - 1;
    }

    @Override
    protected Object getParameterValue(Object[] args)
    {
        return args[argIndex];
    }
}
